#ifndef UDATA_H
#define UDATA_H

#include "free-cube/freecube.h"
#include <QSharedDataPointer>



class UData
{
public:
    typedef unsigned char Byte;
    UData() : data(NULL), size_(0) {}
    ~UData(){delete [] data;}

    const Byte * get(int & size){size = size_; return data;}

    void set(const Byte * data, size_t size){
        size_ = 0;
        delete [] data;
        data = new Byte[size];
        size_ = size;
    }

private:
    fc::TimeT time_; // in miditicks
    QSharedPointer <Byte> data;
    int size_;
};

#endif // UDATA_H
